{% extends "base.html" %}

{% block content %}
    <table>
        <tr valign="top">
            <td><img src="{{ user.avatar(128) }}"></td>
            <td>
                <h1>User: {{ user.username }}</h1>
                {% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
                {% if user.last_seen %}<p>最近上线： {{ user.last_seen }}</p>{% endif %}
                {% if user == current_user %}
                    <p><a href="{{ url_for('edit_profile') }}">编辑个人资料</a></p>
                {% elif not current_user.is_following(user) %}
                    <p><a href="{{ url_for('follow', username=user.username) }}">关注</a></p>
                {% else %}
                    <p><a href="{{ url_for('unfollow', username=user.username) }}">取消关注</a></p>
                {% endif %}
            </td>
        </tr>
    </table>
    <hr>
    {% for post in posts %}
        {% include '_post.html' %}
    {% endfor %}
{% endblock %}